import request from '@/utils/request';

//---------------------- 订单Start---------------------------

// 订单tabs数据 -2
export function getOrderDataApi (data) {
    return request({ url: '/admin/platform/service-order/get_tabs_data', method: 'get', params: data })
}

// 订单列表
export function orderList (data) {
    return request({ url: '/admin/platform/service-order/list', method: 'get', params: data })
}

// 完成订单
export function accomplishOrderApi (data) {
    return request({ url: '/admin/platform/service-order/accomplishOrder', method: 'post', params: data })
}

// 订单导出
export function exportOrder (data) {
    return request({ url: '/admin/platform/service-order/export/serviceOrder', method: 'get', params: data })
}



export function getOrderInfoApi(id){
    return request({url:'/admin/platform/service-order/info',method:'get',params:{id}})
}

//订单日志列表
export function getOrderLogApi(id){
    return request({url:'/admin/platform/service-order/log',method:'get',params:{id}})
}

//订单备注
export function remarkOrderApi(data){
    return request({url:'/admin/platform/service-order/remark',method:'put',params:data})
}

//空闲人员
export function userRelaxDesignList(data){
    return request({url:'/admin/platform/service-staff/staff',method:'get',params:data})
}

export function orderDesignateApi(params){
    return request({
        url:'/admin/platform/service-order/designate',
        method:'put',
        params
    })
}

//取消订单 -2
export function cancelOrderApi(data){
    return request({url:'/admin/platform/service-order/cancel',method:'post',data})
}

//订单改价
export function confirmEditOrderApi(data){
    return request({url:'/admin/platform/service-order/price_edit',method:'put',params:data})
}

//获取退款信息
export function getOrderRefundInfoApi(id){
    return request({
        url:'/admin/platform/service-order-refund/refund',
        method:'get',
        params:{
            orderId:id
        }
    })
}

//退款审核
export function refundOrderApi(data){
    return request({
        url:'/admin/platform/service-order-refund/refund_handling',
        method:'post',
        data
    })
}

//取消通过次卡下单的订单。
export function cardOrderCancelApi(data){
    return request({url:'/admin/platform/service-order/card_order_cancel',method:'post',data})
}

//取消普通订单预约
export function cancelBookOrderApi(data){
    return request({url:'/admin/platform/service-order/cancel_book',method:'post',data})
}

//-----------------------订单END-----------------------------

//----------------------------分类START------------------------------

// 获取列表
export function getServiceCateListApi (data) {
    return request({
        url: '/admin/platform/service-cate/list',
        method: 'get',
        params: data
    })
}

// 显示隐藏
export function cateStatusApi (data) {
    return request({
        url: `/admin/platform/service-cate/set_show`,
        method: 'put',
        params:data
    })
}

// 是否推荐 -2
export function CateIsRecomApi (data) {
    return request({
        url: `/admin/platform/service-cate/is_recom?id=${data.id}&isRecommend=${data.isRecommend}`,
        method: 'put',
        // data,
    })
}


//获取分类详情
export function cateInfoApi(data){
    return request({
        url:'/admin/platform/service-cate/info',
        method:'get',
        params:data
    })
}

//保存分类信息
export function cateInfoSaveApi(data){
    return request({
        url:'/admin/platform/service-cate/save',
        method:'post',
        data
    })
}

//删除分类信息
export function delCateInfoApi(id){
    return request({
        url:'/admin/platform/service-cate/delete',
        method:'get',
        params:{id}
    })
}

//获取服务项目二级分类
export function getSecondCateListApi(){
    return request({url: '/admin/platform/service-cate/selectList',method:'get'})
}


//---------------------------分类END----------------------------------

//---------------------------项目START--------------------------------

// 获取列表
export function getItemListApi (data) {
    return request({
        url: '/admin/platform/service-item/list',
        method: 'get',
        params: data
    })
}

// 是否推荐
export function ItemIsRecomApi (data) {
    return request({
        url: `/admin/platform/service-item/is_recom`,
        method: 'put',
        data
    })
}

// 是否显示
export function ItemStatusApi (data) {
    return request({
        url: `/admin/platform/service-item/set_show`,
        method: 'put',
        params:data
    })
}

// 保存、修改
export function ItemSaveApi (data) {
    return request({
        url: '/admin/platform/service-item/save',
        method: 'post',
        data
    })
}

// 获取一条数据
export function getItemDetailApi (id) {
    return request({
        url: `/admin/platform/service-item/info`,
        method: 'GET',
        params:{id}
    })
}

//获取服务项目标签
export function serviceLabelApi(){
    return request({url:'/admin/platform/service-item/service_label',method:'get'})
}

//删除规格
export function delItemSpecApi(id){
    return request({
        url:`admin/platform/service-item-spec/delete?id=${id}`,
        method:'get'
    })
}

//删除项目
export function itemDelApi(id){
    return request({
        url:`/admin/platform/service-item/delete`,
        method:'get',
        params:{id}
    })
}

//服务项目通过
export function itemAdoptApi(id){
    return request({
        url:'/admin/platform/service-item/adopt',
        method:'put',
        params:{
            id
        }
    })
}

//拒绝服务项目
export function itemRefuseApi(data){
    return request({
        url:'/admin/platform/service-item/refuse',
        method:'put',
        params:data
    })
}

//服务设置是否热销
export function itemSetHotApi(data){
    return request({
        url:'/admin/platform/service-item/set_hot',
        method:'put',
        params:data
    })
}



//-----------------------------项目END--------------------------------

//-----------------------------订单评价START------------------------------------

//评论列表
export function getCommentListApi(data){
    return request({
        url:'/admin/platform/service-order-comment/list',
        method:'get',
        params:data
    })
}

// 评论审核
export function orderCommentVerifyApi (data) {
    return request({ url: '/admin/platform/service-order-comment/order_comment_verify', method: 'PUT', params: data })
}

//评论详情
export function orderCommentDetailApi(id){
    return request({
        url:'/admin/platform/service-order-comment/info',
        method:'get',
        params:{id}
    })
}

//删除评论
export function orderCommentDelApi(id){
    return request({
        url:'/admin/platform/service-order-comment/delete',
        method:'get',
        params:{id}
    })
}

//-----------------------------订单评价END------------------------------------

//-----------------------------反馈建议START------------------------------------

export function getFeedBackList(data){
    return request({
        url:'/admin/platform/service-suggest/list',
        method:'get',
        params: data
    })
}

export function accomplishFeedBack(data){
    return request({
        url:'/admin/platform/service-suggest/accomplish',
        method: 'PUT',
        params: data
    })
}
//-----------------------------反馈建议END------------------------------------

//-----------------------------操作日志START------------------------------------
  /**
 * 获取操作日志
 * @param {*} data 
 * @returns 
 */
   export function getServiceLog(data){
    return request({
        url: '/admin/platform/service-log/list',
        method: 'get',
        params: data
    })
}
//-----------------------------操作日志END------------------------------------

//--------------------------服务人员提现申请START-------------------------------
//申请列表
export function cashListApi(params){
    return request({
        url:'/admin/platform/service-user-extract/index',
        method:'get',
        params
    })
}

//审核通过
export function cashAdoptApi(id){
    return request({
        url:'/admin/platform/service-user-extract/adopt',
        method:'post',
        data:{
            id
        }
    })
}

//审核驳回
export function cashRefuseApi(data){
    return request({
        url:'/admin/platform/service-user-extract/refuse',
        method:'post',
        data
    })
}
//--------------------------服务人员申请END-------------------------------

//获取分类级联树
export function getCodeCateCascApi(){
    return request({
        url:'/admin/platform/service-cate/selectListV5',
        method:'get'
    })
}

export function getOnsiteHomeDiyApi(name){
    return request({
        url:'/admin/platform/uxpagediy/getUxServiceData',
        method:'get',
        params:{
            name
        }
    })
}

export function saveOnsiteDiyData(data){
    return request({
        url:'/admin/platform/uxpagediy/uxServiceSaveData',
        method:'post',
        data
    })
}

//检测权限
export function checkAuth(){
    return request({
      url:'/publicly/uxauth/check',
      method:'get'
    })
  }

// 当面付订单列表
export function getSubOrderListApi(data){
    return request({
        url:'/admin/platform/service-order-subjoin/index',
        method:'get',
        params:data
    })
}